home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / language / harvest.cpt / Harvest C / Tcl 6.2 / tclMacUtil.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-29  |  597 b   |  37 lines

  1. #ifdef macintosh
  2. #    pragma segment tclMacUtil
  3. #endif
  4.  
  5.  
  6. #include "tclInt.h"
  7. #include "errMac.h"
  8.  
  9. int        macintoshErr = 0;
  10.  
  11. char *
  12. Tcl_MacErrorID(errno)
  13. int        errno;
  14. {
  15. static char    macMsg[64];
  16.  
  17.     sprintf(macMsg, "Err#%d", errno);
  18.     return macMsg;
  19.     }
  20.  
  21. char *
  22. Tcl_MacError (interp)
  23. Tcl_Interp *interp;
  24. {
  25. int        idx;
  26. char    *id, *msg;
  27.  
  28.     id = Tcl_MacErrorID(macintoshErr);
  29.     for (    idx = 0 ;    (ErrorCodeTab [idx].errNum  != macintoshErr) && 
  30.                         (ErrorCodeTab [idx].errNum  != -1);
  31.              idx++  )
  32.         ;
  33.     msg = ErrorCodeTab[idx].errCode;
  34.     Tcl_SetErrorCode(interp, "MAC", id, msg, (char *) NULL);
  35.     return msg;
  36. }
  37.